//
//  ContentView.swift
//  learn-ios
//
//  Created by Dong on 2022/3/29.
//

import SwiftUI


struct ContentView: View {

    @State private var selection: Tab = .UserElements
    
    enum Tab {
        case UserElements
        case ViewContainers
        case Interactivity
    }

    var body: some View {
        VStack {
            TabView(selection: $selection) {
                UserElementsView()
                        .tabItem {
                            Label("用户元素", systemImage: "person")
                        }
                        .tag(Tab.UserElements)
                
                ViewContainersView()
                        .tabItem {
                            Label("容器视图", systemImage: "contextualmenu.and.cursorarrow")
                        }
                        .tag(Tab.ViewContainers)
                ToolsView()
                    .tabItem{
                        Label("工具箱",systemImage: "archivebox.fill")
                    }
            }
        }
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
